Optimal. Leaf size=137 \[ -4 a b d e n x+4 b^2 d e n^2 x+\frac {1}{4} b^2 e^2 n^2 x^2-4 b^2 d e n x \log \left (c x^n\right )-\frac {1}{2} b e^2 n x^2 \left (a+b \log \left (c x^n\right )\right )+2 d e x \left (a+b \log \left (c x^n\right )\right )^2+\frac {1}{2} e^2 x^2 \left (a+b \log \left (c x^n\right )\right )^2+\frac {d^2 \left (a+b \log \left (c x^n\right )\right )^3}{3 b n} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.16, antiderivative size = 137, normalized size of antiderivative = 1.00, number of steps
used = 14, number of rules used = 8, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.348, Rules used = {2388, 2339,
30, 2333, 2332, 2367, 2342, 2341} \begin {gather*} \frac {d^2 \left (a+b \log \left (c x^n\right )\right )^3}{3 b n}+2 d e x \left (a+b \log \left (c x^n\right )\right )^2+\frac {1}{2} e^2 x^2 \left (a+b \log \left (c x^n\right )\right )^2-\frac {1}{2} b e^2 n x^2 \left (a+b \log \left (c x^n\right )\right )-4 a b d e n x-4 b^2 d e n x \log \left (c x^n\right )+4 b^2 d e n^2 x+\frac {1}{4} b^2 e^2 n^2 x^2 \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 30
Rule 2332
Rule 2333
Rule 2339
Rule 2341
Rule 2342
Rule 2367
Rule 2388
Rubi steps
\begin {align*} \int \frac {(d+e x)^2 \left (a+b \log \left (c x^n\right )\right )^2}{x} \, dx &=d \int \frac {(d+e x) \left (a+b \log \left (c x^n\right )\right )^2}{x} \, dx+e \int (d+e x) \left (a+b \log \left (c x^n\right )\right )^2 \, dx\\ &=d^2 \int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{x} \, dx+e \int \left (d \left (a+b \log \left (c x^n\right )\right )^2+e x \left (a+b \log \left (c x^n\right )\right )^2\right ) \, dx+(d e) \int \left (a+b \log \left (c x^n\right )\right )^2 \, dx\\ &=d e x \left (a+b \log \left (c x^n\right )\right )^2+(d e) \int \left (a+b \log \left (c x^n\right )\right )^2 \, dx+e^2 \int x \left (a+b \log \left (c x^n\right )\right )^2 \, dx+\frac {d^2 \text {Subst}\left (\int x^2 \, dx,x,a+b \log \left (c x^n\right )\right )}{b n}-(2 b d e n) \int \left (a+b \log \left (c x^n\right )\right ) \, dx\\ &=-2 a b d e n x+2 d e x \left (a+b \log \left (c x^n\right )\right )^2+\frac {1}{2} e^2 x^2 \left (a+b \log \left (c x^n\right )\right )^2+\frac {d^2 \left (a+b \log \left (c x^n\right )\right )^3}{3 b n}-(2 b d e n) \int \left (a+b \log \left (c x^n\right )\right ) \, dx-\left (2 b^2 d e n\right ) \int \log \left (c x^n\right ) \, dx-\left (b e^2 n\right ) \int x \left (a+b \log \left (c x^n\right )\right ) \, dx\\ &=-4 a b d e n x+2 b^2 d e n^2 x+\frac {1}{4} b^2 e^2 n^2 x^2-2 b^2 d e n x \log \left (c x^n\right )-\frac {1}{2} b e^2 n x^2 \left (a+b \log \left (c x^n\right )\right )+2 d e x \left (a+b \log \left (c x^n\right )\right )^2+\frac {1}{2} e^2 x^2 \left (a+b \log \left (c x^n\right )\right )^2+\frac {d^2 \left (a+b \log \left (c x^n\right )\right )^3}{3 b n}-\left (2 b^2 d e n\right ) \int \log \left (c x^n\right ) \, dx\\ &=-4 a b d e n x+4 b^2 d e n^2 x+\frac {1}{4} b^2 e^2 n^2 x^2-4 b^2 d e n x \log \left (c x^n\right )-\frac {1}{2} b e^2 n x^2 \left (a+b \log \left (c x^n\right )\right )+2 d e x \left (a+b \log \left (c x^n\right )\right )^2+\frac {1}{2} e^2 x^2 \left (a+b \log \left (c x^n\right )\right )^2+\frac {d^2 \left (a+b \log \left (c x^n\right )\right )^3}{3 b n}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.03, size = 114, normalized size = 0.83 \begin {gather*} \frac {1}{4} b e^2 n x^2 \left (-2 a+b n-2 b \log \left (c x^n\right )\right )+2 d e x \left (a+b \log \left (c x^n\right )\right )^2+\frac {1}{2} e^2 x^2 \left (a+b \log \left (c x^n\right )\right )^2+\frac {d^2 \left (a+b \log \left (c x^n\right )\right )^3}{3 b n}-4 b d e n x \left (a-b n+b \log \left (c x^n\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 9 vs. order
3.
time = 0.32, size = 2543, normalized size = 18.56
method | result | size |
risch | \(\text {Expression too large to display}\) | \(2543\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 198, normalized size = 1.45 \begin {gather*} \frac {1}{2} \, b^{2} x^{2} e^{2} \log \left (c x^{n}\right )^{2} + 2 \, b^{2} d x e \log \left (c x^{n}\right )^{2} - \frac {1}{2} \, a b n x^{2} e^{2} - 4 \, a b d n x e + a b x^{2} e^{2} \log \left (c x^{n}\right ) + 4 \, a b d x e \log \left (c x^{n}\right ) + \frac {b^{2} d^{2} \log \left (c x^{n}\right )^{3}}{3 \, n} + \frac {1}{2} \, a^{2} x^{2} e^{2} + 4 \, {\left (n^{2} x - n x \log \left (c x^{n}\right )\right )} b^{2} d e + 2 \, a^{2} d x e + \frac {a b d^{2} \log \left (c x^{n}\right )^{2}}{n} + a^{2} d^{2} \log \left (x\right ) + \frac {1}{4} \, {\left (n^{2} x^{2} - 2 \, n x^{2} \log \left (c x^{n}\right )\right )} b^{2} e^{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 277 vs.
\(2 (130) = 260\).
time = 0.46, size = 277, normalized size = 2.02 \begin {gather*} \frac {1}{3} \, b^{2} d^{2} n^{2} \log \left (x\right )^{3} + \frac {1}{4} \, {\left (b^{2} n^{2} - 2 \, a b n + 2 \, a^{2}\right )} x^{2} e^{2} + 2 \, {\left (2 \, b^{2} d n^{2} - 2 \, a b d n + a^{2} d\right )} x e + \frac {1}{2} \, {\left (b^{2} x^{2} e^{2} + 4 \, b^{2} d x e\right )} \log \left (c\right )^{2} + \frac {1}{2} \, {\left (b^{2} n^{2} x^{2} e^{2} + 4 \, b^{2} d n^{2} x e + 2 \, b^{2} d^{2} n \log \left (c\right ) + 2 \, a b d^{2} n\right )} \log \left (x\right )^{2} - \frac {1}{2} \, {\left ({\left (b^{2} n - 2 \, a b\right )} x^{2} e^{2} + 8 \, {\left (b^{2} d n - a b d\right )} x e\right )} \log \left (c\right ) + \frac {1}{2} \, {\left (2 \, b^{2} d^{2} \log \left (c\right )^{2} + 2 \, a^{2} d^{2} - {\left (b^{2} n^{2} - 2 \, a b n\right )} x^{2} e^{2} - 8 \, {\left (b^{2} d n^{2} - a b d n\right )} x e + 2 \, {\left (b^{2} n x^{2} e^{2} + 4 \, b^{2} d n x e + 2 \, a b d^{2}\right )} \log \left (c\right )\right )} \log \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.48, size = 269, normalized size = 1.96 \begin {gather*} \begin {cases} \frac {a^{2} d^{2} \log {\left (c x^{n} \right )}}{n} + 2 a^{2} d e x + \frac {a^{2} e^{2} x^{2}}{2} + \frac {a b d^{2} \log {\left (c x^{n} \right )}^{2}}{n} - 4 a b d e n x + 4 a b d e x \log {\left (c x^{n} \right )} - \frac {a b e^{2} n x^{2}}{2} + a b e^{2} x^{2} \log {\left (c x^{n} \right )} + \frac {b^{2} d^{2} \log {\left (c x^{n} \right )}^{3}}{3 n} + 4 b^{2} d e n^{2} x - 4 b^{2} d e n x \log {\left (c x^{n} \right )} + 2 b^{2} d e x \log {\left (c x^{n} \right )}^{2} + \frac {b^{2} e^{2} n^{2} x^{2}}{4} - \frac {b^{2} e^{2} n x^{2} \log {\left (c x^{n} \right )}}{2} + \frac {b^{2} e^{2} x^{2} \log {\left (c x^{n} \right )}^{2}}{2} & \text {for}\: n \neq 0 \\\left (a + b \log {\left (c \right )}\right )^{2} \left (d^{2} \log {\left (x \right )} + 2 d e x + \frac {e^{2} x^{2}}{2}\right ) & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 321 vs.
\(2 (130) = 260\).
time = 2.24, size = 321, normalized size = 2.34 \begin {gather*} \frac {1}{2} \, b^{2} n^{2} x^{2} e^{2} \log \left (x\right )^{2} + 2 \, b^{2} d n^{2} x e \log \left (x\right )^{2} + \frac {1}{3} \, b^{2} d^{2} n^{2} \log \left (x\right )^{3} - \frac {1}{2} \, b^{2} n^{2} x^{2} e^{2} \log \left (x\right ) - 4 \, b^{2} d n^{2} x e \log \left (x\right ) + b^{2} n x^{2} e^{2} \log \left (c\right ) \log \left (x\right ) + 4 \, b^{2} d n x e \log \left (c\right ) \log \left (x\right ) + b^{2} d^{2} n \log \left (c\right ) \log \left (x\right )^{2} + \frac {1}{4} \, b^{2} n^{2} x^{2} e^{2} + 4 \, b^{2} d n^{2} x e - \frac {1}{2} \, b^{2} n x^{2} e^{2} \log \left (c\right ) - 4 \, b^{2} d n x e \log \left (c\right ) + \frac {1}{2} \, b^{2} x^{2} e^{2} \log \left (c\right )^{2} + 2 \, b^{2} d x e \log \left (c\right )^{2} + a b n x^{2} e^{2} \log \left (x\right ) + 4 \, a b d n x e \log \left (x\right ) + b^{2} d^{2} \log \left (c\right )^{2} \log \left (x\right ) + a b d^{2} n \log \left (x\right )^{2} - \frac {1}{2} \, a b n x^{2} e^{2} - 4 \, a b d n x e + a b x^{2} e^{2} \log \left (c\right ) + 4 \, a b d x e \log \left (c\right ) + 2 \, a b d^{2} \log \left (c\right ) \log \left (x\right ) + \frac {1}{2} \, a^{2} x^{2} e^{2} + 2 \, a^{2} d x e + a^{2} d^{2} \log \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.78, size = 152, normalized size = 1.11 \begin {gather*} {\ln \left (c\,x^n\right )}^2\,\left (\frac {b^2\,e^2\,x^2}{2}+2\,b^2\,d\,e\,x+\frac {a\,b\,d^2}{n}\right )+\ln \left (c\,x^n\right )\,\left (\frac {b\,\left (2\,a-b\,n\right )\,e^2\,x^2}{2}+4\,b\,d\,\left (a-b\,n\right )\,e\,x\right )+a^2\,d^2\,\ln \left (x\right )+\frac {e^2\,x^2\,\left (2\,a^2-2\,a\,b\,n+b^2\,n^2\right )}{4}+2\,d\,e\,x\,\left (a^2-2\,a\,b\,n+2\,b^2\,n^2\right )+\frac {b^2\,d^2\,{\ln \left (c\,x^n\right )}^3}{3\,n} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________